package com.peter.ai;

import java.io.File;

import com.peter.ai.util.FileUtils;
import com.peter.ai.voice.BaiduClientIntance;

/**
 * Hello world!
 *
 */
public class App {
	public static void main(String[] args) {
		final String txtDir = "E://text2voice/txt/";
		final String mp3Dir = "E://text2voice/mp3/";
		BaiduClientIntance instance = new BaiduClientIntance();
		FileUtils.splitFile("E://text2voice/捞尸人.txt", "天才本站地址:(mao86),-----------", txtDir);
		File dir = new File(txtDir);
		File[] files = dir.listFiles();
		for (File file : files) {
			if (file.getName().contains(".txt")) {
				String text = FileUtils.readFile(file.getAbsolutePath());
				instance.text2Voice(file.getName().substring(0, file.getName().indexOf(".")), text, mp3Dir);
			}
		}
//		instance.text2Voice("2第三章  规矩.txt", FileUtils.readFile(txtDir+"2第三章  规矩.txt"), mp3Dir);
		
	}
}
